package cn.kgc.service.impl;

import cn.kgc.mapper.BackUserMapper;
import cn.kgc.pojo.*;
import cn.kgc.service.BackUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class BackUserServiceImpl implements BackUserService {
    @Resource
    private BackUserMapper backUserMapper;

    @Override
    public String login(String devcode, String password) {
        String loginName=backUserMapper.selectUserByUser(devcode,password);
        return loginName;
    }

    @Override
    public List<AppInfo> queryALLApp(int indexNum, int pageSize,String querySoftwareName,String checkFlat,String queryLevel1,String queryCategoryLevel2,String queryCategoryLevel3) {
        List<AppInfo> queryAllApp=backUserMapper.appList(indexNum,pageSize,querySoftwareName,checkFlat,queryLevel1, queryCategoryLevel2,queryCategoryLevel3);

        return queryAllApp;
    }

    @Override
    public List<AppInfo> checkApp( String versionId) {
        List<AppInfo> checkApp=backUserMapper.checkApp(versionId);
        return checkApp;
    }

    @Override
    public List<AppVersion> checkVersion(String id) {
        List<AppVersion> checkVersion=backUserMapper.checkVersion(id);
        return checkVersion;
    }

    @Override
    public int totalCount(String querySoftwareName,String checkFlat,String queryLevel1,String queryCategoryLevel2,String queryCategoryLevel3) {
        int result=backUserMapper.totalCount(querySoftwareName,checkFlat,queryLevel1,queryCategoryLevel2,queryCategoryLevel3);
        return result;
    }

    @Override
    public List<DataDictionary> checkFloat() {
        List<DataDictionary> checkFloat=backUserMapper.checkFloat();
        return checkFloat;
    }

    @Override
    public List<AppCategory> checkLevel1() {
        List<AppCategory> checkLevel1=backUserMapper.checkLevel1();

        return checkLevel1;
    }

    @Override
    public List<AppCategory> checkLevel2(String level1) {
        List<AppCategory> checkLevel2=backUserMapper.checkLevel2(level1);
        return checkLevel2;
    }

    @Override
    public List<AppCategory> checkLevel3(String level2) {
        List<AppCategory> checkLevel3=backUserMapper.checkLevel3(level2);
        return checkLevel3;
    }

    @Override
    public int checkSave(String id) {
        int result=backUserMapper.checkSave(id);
        return result;
    }

    @Override
    public int checkSaves(String id) {
        int result=backUserMapper.checkSaves(id);
        return result;
    }
}
